#include "newform.h"
#include "ui_newform.h"
#include "resultform.h"
#include "mainwindow.h"
#include "dataform.h"

NewForm::NewForm(QWidget* parent) : QWidget(parent),
    ui(new Ui::NewForm)
{
    ui->setupUi(this);

    setAttribute(Qt::WA_DeleteOnClose);
}

NewForm::~NewForm()
{
    delete ui;
}

void NewForm::on_pushButton_clicked()
{
    QString title = ui->lineEdit->text();

    int objectCount = ui->spinBox->value();

    QString subjectsText = ui->textEdit->toPlainText();
    QStringList subjectsList = subjectsText.split("\n", QString::SkipEmptyParts);

    emit openDataForm(title, subjectsList, objectCount);
}
